package request

import (
	"gitee.com/cjsn/topsdk/util"
)

type TmallServicecenterFulfiltaskInsuranceActionRequest struct {
	/*
	   履约动作，取值：send_goods, 上门取件;supplier_signed, 服务商签收;evaluate_report, 鉴定报告;insurance_claims, 保险理赔;send_back, 寄回;repair_finish, 维修完成;     */
	TaskAction *string `json:"task_action,omitempty" required:"false" `
	/*
	   工单id     */
	WorkcardId *int64 `json:"workcard_id,omitempty" required:"false" `
	/*
	   履行单id     */
	FulfilTaskId *int64 `json:"fulfil_task_id,omitempty" required:"false" `
	/*
	   履约动作数据，不同动作取值见api文档；     */
	TaskContextData *map[string]interface{} `json:"task_context_data,omitempty" required:"false" `
	/*
	   外部单号id     */
	OuterId *string `json:"outer_id,omitempty" required:"false" `
}

func (s *TmallServicecenterFulfiltaskInsuranceActionRequest) SetTaskAction(v string) *TmallServicecenterFulfiltaskInsuranceActionRequest {
	s.TaskAction = &v
	return s
}
func (s *TmallServicecenterFulfiltaskInsuranceActionRequest) SetWorkcardId(v int64) *TmallServicecenterFulfiltaskInsuranceActionRequest {
	s.WorkcardId = &v
	return s
}
func (s *TmallServicecenterFulfiltaskInsuranceActionRequest) SetFulfilTaskId(v int64) *TmallServicecenterFulfiltaskInsuranceActionRequest {
	s.FulfilTaskId = &v
	return s
}
func (s *TmallServicecenterFulfiltaskInsuranceActionRequest) SetTaskContextData(v map[string]interface{}) *TmallServicecenterFulfiltaskInsuranceActionRequest {
	s.TaskContextData = &v
	return s
}
func (s *TmallServicecenterFulfiltaskInsuranceActionRequest) SetOuterId(v string) *TmallServicecenterFulfiltaskInsuranceActionRequest {
	s.OuterId = &v
	return s
}

func (req *TmallServicecenterFulfiltaskInsuranceActionRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.TaskAction != nil {
		paramMap["task_action"] = *req.TaskAction
	}
	if req.WorkcardId != nil {
		paramMap["workcard_id"] = *req.WorkcardId
	}
	if req.FulfilTaskId != nil {
		paramMap["fulfil_task_id"] = *req.FulfilTaskId
	}
	if req.TaskContextData != nil {
		paramMap["task_context_data"] = util.ConvertStruct(*req.TaskContextData)
	}
	if req.OuterId != nil {
		paramMap["outer_id"] = *req.OuterId
	}
	return paramMap
}

func (req *TmallServicecenterFulfiltaskInsuranceActionRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
